package es.onlysolutions.gs.comm.entity;

import es.onlysolutions.arq.core.accesobd.IEntityId;
import com.google.gdata.data.TextConstruct;

/**
 * Entity for the table t_video. Represents a video entry of YouTube.
 */
public class Video implements IEntityId
{

    private Long id;
    private String youTubeId;
    private User user = new User();
    private String title;
    private String content;
    private String imageUrl;

    public String getIdName()
    {
        return "id";
    }


    public Long getId()
    {
        return id;
    }

    public void setId(Long id)
    {
        this.id = id;
    }

    public String getYouTubeId()
    {
        return youTubeId;
    }

    public void setYouTubeId(String youTubeId)
    {
        this.youTubeId = youTubeId;
    }

    public User getUser()
    {
        return user;
    }

    public void setUser(User user)
    {
        this.user = user;
    }

    public boolean equals(Object o)
    {
        if (this == o)
        {
            return true;
        }
        if (o == null || getClass() != o.getClass())
        {
            return false;
        }

        Video video = (Video) o;

        if (id != null ? !id.equals(video.id) : video.id != null)
        {
            return false;
        }

        return true;
    }

    public int hashCode()
    {
        return (id != null ? id.hashCode() : 0);
    }


    public String toString()
    {
        return "Video{" +
                "id=" + id +
                ", youTubeId='" + youTubeId + '\'' +
                ", user=" + user +
                '}';
    }

    public void setTitle(String title)
    {
        this.title = title;
    }

    public String getTitle()
    {
        return title;
    }

    public void setContent(String content)
    {
        this.content = content;
    }

    public void setImageUrl(String imageUrl)
    {
        this.imageUrl = imageUrl;
    }

    public String getContent()
    {
        return content;
    }

    public String getImageUrl()
    {
        return imageUrl;
    }
}
